package com.hyfrogx.modules.job.task;

import com.hyfrogx.modules.sys.entity.SysUserEntity;
import com.hyfrogx.modules.sys.service.SysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时任务测试
 *
 * testTask为spring bean的名称
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.2.0 2016-11-28
 */
@Component("testTask")
public class TestTask {
	private Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private SysUserService sysUserService;

	public void test(String params){
		logger.info("带参数的计划任务Test测试：" + params);

		try {
			Thread.sleep(1000L);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

		SysUserEntity user = sysUserService.getById(1L);
//		System.out.println(ToStringBuilder.reflectionToString(user));

	}


	public void test2(){
		logger.info("不带参数的计划任务Test2测试");
	}
}
